// JavaScript Document

function getHTTPObject() 
{
	var xmlhttp; 
  	if(window.XMLHttpRequest)
  	{
    	xmlhttp = new XMLHttpRequest();
  	}
  	else if (window.ActiveXObject)
  	{
    	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    	if (!xmlhttp)
		{
        	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}   
	}
  	return xmlhttp;
}


function showhabitq2(formId)
{
	var httpQuote = getHTTPObject();
	//var num_unhabit=window.document.getElementById('num_unhabit').value;
	var url = "edit_q2_unhabit.php";
	//var param = "num_unhabit="+num_unhabit;
	var param = "form_id="+formId;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if (httpQuote.status==200 )
		{
			//alert(httpQuote.responseText);
			document.getElementById('show_unhabit').innerHTML=httpQuote.responseText;
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}